package com.itheima;

import com.itheima.jdbc.ConnectionData;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AppForDi {
    public static void main(String[] args) {

        //TODO 将conn改为,使用spring技术创建对象,获取对象
        ConnectionData conn = new ConnectionData();
        System.out.println(conn);

        ApplicationContext ac=new ClassPathXmlApplicationContext("applicationContext.xml");
        Object connectionData = ac.getBean("connectionData");
        System.out.println(connectionData);
    }
}
